package enum

/**
 * 初始化方向枚举
 */
enum class Direction(val desc: String) {
    NORTH("北方"), SOUTH("南方"), WEST("西方"), EAST("东方")
}

fun main(args: Array<String>) {
    println("打印参数：名称：${Direction.NORTH.name},顺序号：${Direction.NORTH.ordinal},自定义参数：${Direction.NORTH.desc},${Direction.NORTH.declaringClass}")

    //如果Value不匹配(区分大小写)，则会抛出IllegalArgumentException异常
//    println(Direction.valueOf("Sou"))
    println(Direction.valueOf("SOUTH"))

    Direction.values().map {
        println("英文：${it.name}，方向：${it.desc}")
    }

}